from rich.console import Console
from rich.theme import Theme

# 定义7种颜色主题
custom_theme = Theme({
    "danger": "bold red",
    "warning": "bold yellow",
    "success": "bold green",
    "info": "bold blue",
    "highlight": "bold magenta",
    "special": "bold cyan",
    "critical": "bold white on red"
})

console = Console(theme=custom_theme)

# 7种不同颜色的警示信息
console.print("[danger]危险：系统检测到严重错误！[/]")
console.print("[warning]警告：磁盘空间不足！[/]")
console.print("[success]成功：操作已完成！[/]")
console.print("[info]信息：系统运行正常[/]")
console.print("[highlight]重点：请检查此配置项[/]")
console.print("[special]特殊：检测到异常模式[/]")
console.print("[critical]紧急：系统即将崩溃！[/]")
